home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / fkeymenu.zip / TEST.BAT < prev   
DOS Batch File  |  1991-11-06  |  4KB  |  85 lines

  1. @echo off
  2. rem                           ┌──────────┐
  3. rem                           │ TEST.BAT │
  4. rem                           └──────────┘
  5. rem     A minor tutorial on the ANSI commands to control the screen
  6. rem     cursor, colors, and "special effects."  ANSI.SYS must be added
  7. rem     to the CONFIG.SYS file.  First run this batch file, then read
  8. rem     the statements above each command in this batch file.
  9. rem
  10. rem     "This" means (or is equal to) the command on the next line
  11. rem
  12. rem     This sets the screen to bright white on blue
  13. echo 
  14. rem     This clears the screen (same as CLS command)
  15. echo 
  16. rem     This sets the cursor to row 12 column 20 displays a message
  17. rem     in the screen colors
  18. echo 20H  THIS IS BRIGHT WHITE ON BLUE BACKGROUND
  19. rem     This is DOS's pause command.  It allows you to read the message
  20. pause
  21. rem     This goes back to the message and erases it; uses ANSI cursor
  22. rem     location commands (H for position, K to erase to the end of the
  23. rem     line)
  24. echo 1H 
  25. echo 1H 
  26. rem     This locates the cursor and sets a command in color
  27. echo 25H  PRESS ENTER TO CONTINUE
  28. rem     Nul is a DOS ==device==.  It is a "bit bucket" and anything
  29. rem     written to it is discarded.  Try writing FROM Nul and see what
  30. rem     you get (no it's not dangerous or habit forming).  Used with the
  31. rem     redirection operator (>) it suppresses the pause statement and
  32. rem     allows you to use one of your own.
  33. pause>nul
  34. rem     This erases the above command to background color
  35. echo H  
  36. rem     This sets the screen to bright white on green
  37. echo 
  38. rem     This time we don't clear the screen so only new letters
  39. rem     change to the new colors!
  40. rem     This sets the cursor to row 12 column 20 &
  41. rem     This displays a message in the NEW screen colors
  42. echo 20H  THIS IS BRIGHT WHITE ON GREEN BACKGROUND
  43. pause
  44. rem     This goes back to the message and erases it
  45. echo 1H 
  46. echo 1H 
  47. rem     This places the pause command on the 5th row of the screen
  48. echo H
  49. pause
  50. rem     This erases the pause statement in the new color
  51. echo H 
  52. rem     This time we do three (3) things. Place the message, change the
  53. rem     colors of just that portion of the screen and set the
  54. rem     screen message to bright blinking red on black
  55. echo 20H   THIS IS BLINKING BRIGHT RED ON BLACK BACKGROUND
  56. rem     This is non blinking red on black
  57. echo 25H     Press any Key to Continue!
  58. pause>nul
  59. rem     This goes back to the message and erases it
  60. echo 1H 
  61. echo 1H 
  62. echo 20H     PRESS ANY KEY TO END......
  63. pause>nul
  64. rem     And lastly, who says you can't draw colored boxes with
  65. rem     ASCII and ANSI stuff!
  66. rem     Just remember that ANSI code takes no space and adjust for
  67. rem     it when making boxes, see below, if you count the spaces,
  68. rem     you will find that the two ANSI code strings before and after
  69. rem     "OR" take up no space so that the positions are off by the 12
  70. rem     spaces on either side.
  71. rem     References for this stuff are in ANSICOLR.DOC
  72. echo 
  73. cls
  74. echo 10H    ╒══════════════════════════════════════════════╕
  75. echo 10H    │          A N S I   M A D E   E A S Y         │
  76. echo 10H    │                                              │
  77. echo 10H    │                     O R                      │
  78. echo 10H    │                                              │
  79. echo 10H    ╘════C O L O R   F O R   B A T C H   F I L E S═╛
  80.  
  81. echo 10H               PRESS ─┘ {Enter} to say Goodbye
  82. pause>nul
  83. rem     This next command is the ASCII character 7, or beep
  84. echo 
  85.